{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "91f2beba",
   "metadata": {},
   "source": [
    "# 本周知识点\n",
    "### * 元组，集合和字典的基本概念和常见的方法\n",
    "> 1. 元组\n",
    "> 2. 集合\n",
    "> 3. 字典"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "eb569d26",
   "metadata": {},
   "source": [
    "## 1.元组（tupie)\n",
    "> 1. 概念\n",
    ">> 1. 具有和序列数据相同的运算规则：取值和切片\n",
    ">> 2. 表征：（12345，54321，\"hello!\")，用圆括号/小括号 括起来\n",
    "> 2. 性质：不可变性,没有增删改的方法"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "id": "2abcb78d",
   "metadata": {},
   "outputs": [],
   "source": [
    "product = (\"Head First Python\",88) # 创建了一个元组"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "id": "630f057d",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "('Head First Python', 88) <class 'tuple'>\n"
     ]
    }
   ],
   "source": [
    "print(product,type(product))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "id": "e5d6c65b",
   "metadata": {},
   "outputs": [],
   "source": [
    "# 案例\n",
    "import time"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "id": "f94c59ad",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "time.struct_time(tm_year=2022, tm_mon=10, tm_mday=31, tm_hour=10, tm_min=21, tm_sec=49, tm_wday=0, tm_yday=304, tm_isdst=0)"
      ]
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "time.localtime()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "id": "037871f6",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(1800001, 1800002, 1800003)"
      ]
     },
     "execution_count": 8,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "name_seq = 1800001,1800002,1800003\n",
    "name_seq"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "bba00b90",
   "metadata": {},
   "source": [
    "## 2.集合（sets)\n",
    "> 1. 集合的概念\n",
    ">> 1. 没有重复元素的一个数据结构\n",
    ">> 2. 形态：{'apple','orange','apple','pear','banana'}"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "id": "595df784",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "{'apple', 'orange'} <class 'set'>\n"
     ]
    }
   ],
   "source": [
    "basket = {'apple','orange','apple'}\n",
    "print(basket,type(basket))"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "32a9c298",
   "metadata": {},
   "source": [
    "## 3.字典（dict）\n",
    "> 1. 基本的概念\n",
    "> 2. 字典的创建\n",
    "> 3. 常用的方法"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "5925a396",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.9.12"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
